package com.ft.oa.enums;

/**
 * 子项目类型 0自研产品实施,1集成产品实施,2研发定制开发
 */
public enum ProjectType {

    SELF(0,"自研产品实施"),
    UNIT(1,"集成产品实施"),
    DIY(2,"研发定制开发");


    //名称
    private String name;
    //编码
    private int code;
    //构造函数
    ProjectType(int code, String name){
        this.code = code;
        this.name = name;
    }

    /**
     * 获取名称
     * @param code
     * @return
     */
    public static String getByCode(int code) {
        for (ProjectType value : ProjectType.values()) {
            if (value.code == code) {
                return value.name;
            }
        }
        return "";
    }
}
